﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.IO;


namespace ClassLibrary
{
    public class Core
    {
        public PatientCollection Patientcollection { get; private set; }

        public Core()
        {
            this.Patientcollection = new PatientCollection();
        }
        public void SaveCore(Stream outStream)
        {
            DataContractSerializer serializer = new DataContractSerializer(typeof(Core));
            serializer.WriteObject(outStream, this);
        }
        public static Core LoadCore(Stream inStream)
        {
            DataContractSerializer serializer = new DataContractSerializer(typeof(Core));
            return serializer.ReadObject(inStream) as Core;
        }
    }
}
